package com.architecture.util.email;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * <p>This class has utilities methods for be used with E-mails.</p>
 * @author JR
 * @version 1.0
 * @category E-Mail Utilities
 */
public final class EMailUtility {
	
	/**
	 * <p>Represents a regex pattern of a valid e-mail.<p>
	 */
	public static final String REGEX_EMAIL = ".+@.+\\.[a-z]+";
	
	/**
	 * private constructor of <code>EMailUtility</code>.
	 */
	private EMailUtility() {
		super();
	}

	/**
	 * <p>Verify if a e-mail has a valid format.</p>
	 * @param email
	 * @return <code>Boolean</code>
	 */
	public static Boolean isEmail(final String email){
		final Pattern pattern = Pattern.compile(REGEX_EMAIL);
		final Matcher matcher = pattern.matcher(email);
		return matcher.find();
	}
}
